<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title>pgbouncer-admin</title>
  <body>
    <p>PgBouncer Administration Console.</p>
    <section>
      <title>Synopsis</title>
      <codeblock>psql -p <varname>port</varname> pgbouncer</codeblock>
    </section>
    <section>
      <title>Description</title>
        <p>The PgBouncer Administration Console is available via <codeph>psql</codeph>. Connect to the PgBouncer <codeph><varname>port</varname></codeph> and the virtual database named <codeph>pgbouncer</codeph> to log in to the console.</p>
        <p>Users listed in the <codeph>pgbouncer.ini</codeph> configuration parameters <codeph>admin_users</codeph> and <codeph>stats_users</codeph> have privileges to log in to the PgBouncer Administration Console.</p>
        <p>You can control connections between PgBouncer and Greenplum Database from the console. You can also set PgBouncer configuration parameters. </p>
    </section>
    <section>
        <title>Options</title>
        <parml>
          <plentry>
            <pt>-p <varname>port</varname> </pt>
            <pd>The PgBouncer port number.</pd>
          </plentry>
        </parml>
    </section>
  </body>

  <topic id="topic_bk3_3jc_dt">
    <title>Command Syntax</title>
    <body>
      <codeblock>pgbouncer=# SHOW help;
NOTICE:  Console usage
DETAIL:  
    SHOW HELP|CONFIG|DATABASES|POOLS|CLIENTS|SERVERS|VERSION
    SHOW FDS|SOCKETS|ACTIVE_SOCKETS|LISTS|MEM
    SHOW DNS_HOSTS|DNS_ZONES
    SHOW STATS|STATS_TOTALS|STATS_AVERAGES
    SET key = arg
    RELOAD
    PAUSE [&lt;db>]
    RESUME [&lt;db>]
    DISABLE &lt;db>
    ENABLE &lt;db>
    KILL &lt;db>
    SUSPEND
    SHUTDOWN</codeblock>
    </body>
  </topic>

  <topic id="topic_bf5_jcl_gs">
    <title>Administration Commands</title>
    <body>
      <p>The following PgBouncer administration commands control the running <codeph>pgbouncer</codeph> process.</p>
      <parml>
        <plentry>
          <pt>PAUSE [<varname>db</varname>]</pt>
          <pd>If no database is specified, PgBouncer tries to disconnect from all servers, first
            waiting for all queries to complete. The command will not return before all queries
            are finished. This command is to be used to prepare to restart the database.</pd>
          <pd>If a database name is specified, PgBouncer pauses only that database.</pd>
          <pd>If you run a <codeph>PAUSE <varname>db</varname></codeph> command, and then
            a <codeph>PAUSE</codeph> command to pause all databases, you must execute two
              <codeph>RESUME</codeph> commands, one for all databases, and one for the named
            database.</pd>
        </plentry>
        <plentry>
          <pt>SUSPEND</pt>
          <pd>All socket buffers are flushed and PgBouncer stops listening for data on them. The
            command will not return before all buffers are empty. To be used when rebooting
            PgBouncer online.</pd>
        </plentry>
        <plentry>
          <pt>RESUME [ <varname>db</varname> ]</pt>
          <pd>Resume work from a previous <codeph>PAUSE</codeph> or <codeph>SUSPEND</codeph>
            command.</pd>
          <pd>If a database was specified for the <codeph>PAUSE</codeph> command, the database
            must also be specified with the <codeph>RESUME</codeph> command.</pd>
          <pd>After pausing all databases with the <codeph>PAUSE</codeph> command, resuming a
            single database with <codeph>RESUME <varname>db</varname></codeph> is not
            supported.</pd>
        </plentry>
        <plentry>
          <pt>DISABLE <varname>db</varname></pt>
          <pd>Reject all new client connections on the database.</pd>
        </plentry>
        <plentry>
          <pt>ENABLE <varname>db</varname></pt>
          <pd>Allow new client connections on the database.</pd>
        </plentry>
        <plentry>
          <pt>KILL <varname>db</varname></pt>
          <pd>Immediately drop all client and server connections to the named database.</pd>
        </plentry>
        <plentry>
          <pt>SHUTDOWN</pt>
          <pd>Stop PgBouncer process. To exit from the <codeph>psql</codeph> command line
            session, enter <codeph>\q</codeph>.</pd>
        </plentry>
        <plentry>
          <pt>RECONNECT</pt>
          <pd>Close each open server connection for the given database, or all databases, after it
            is released (according to the pooling mode), even if its lifetime is not up yet. New
            server connections can be made immediately and will connect as necessary according to
            the pool size settings.</pd>
          <pd>This command is useful when the server connection setup has changed, for example to
            perform a gradual switchover to a new server. It is <i>not</i> necessary to run this
            command when the connection string in pgbouncer.ini has been changed and reloaded (see
              <codeph>RELOAD</codeph>) or when DNS resolution has changed, because then the
            equivalent of this command will be run automatically. This command is only necessary if
            something downstream of PgBouncer routes the connections.</pd>
          <pd>After this command is run, there could be an extended period where some server
            connections go to an old destination and some server connections go to a new
            destination. This is likely only sensible when switching read-only traffic between
            read-only replicas, or when switching between nodes of a multimaster replication setup.
            If all connections need to be switched at the same time, <codeph>PAUSE</codeph> is
            recommended instead. To close server connections without waiting (for example, in
            emergency failover rather than gradual switchover scenarios), also consider
              <codeph>KILL</codeph>.</pd>
        </plentry>
        <plentry>
          <pt>RELOAD</pt>
          <pd>The PgBouncer process reloads the current configuration file and updates the
            changeable settings.</pd>
        </plentry>
        <plentry>
          <pt>WAIT_CLOSE [ <varname>db</varname> ]</pt>
          <pd>Wait until all server connections, either of the specified database or of all
            databases, have cleared the “close_needed” state (see <codeph>SHOW SERVERS</codeph>). This can be
            called after a <codeph>RECONNECT</codeph> or <codeph>RELOAD</codeph> to wait until the respective
            configuration change has been fully activated, for example in switchover
            scripts.</pd>
        </plentry>
        <plentry>
          <pt>SET <varname>key</varname> = <varname>value</varname></pt>
          <pd>Override specified configuration setting. See the <xref href="#CONFIG"
              format="dita"><codeph>SHOW CONFIG;</codeph></xref> command.</pd>
        </plentry>
      </parml>
    </body>
  </topic>
  <topic id="topic_zfh_2dl_gs">
    <title>SHOW Command</title>
    <body>
      <p>The <codeph>SHOW <varname>category</varname></codeph> command displays different types
        of PgBouncer information. You can specify one of the following categories:<ul
          id="ul_ims_tgl_gs">
          <li><xref href="#ACTIVE_SOCKETS" format="dita">ACTIVE_SOCKETS</xref></li>
          <li><xref href="#CLIENTS" format="dita">CLIENTS</xref></li>
          <li><xref href="#CONFIG" format="dita">CONFIG</xref></li>
          <li><xref href="#DATABASES" format="dita">DATABASES</xref></li>
          <li><xref href="#DNS_HOSTS" format="dita">DNS_HOSTS</xref></li>
          <li><xref href="#DNS_ZONES" format="dita">DNS_ZONES</xref></li>
          <li><xref href="#FDS" format="dita">FDS</xref></li>
          <li><xref href="#POOLS" format="dita">POOLS</xref></li>
          <li><xref href="#SERVERS" format="dita">SERVERS</xref></li>
          <li><xref href="#SOCKETS" format="dita">SOCKETS</xref></li>
          <li><xref href="#STATS" format="dita">STATS</xref></li>
          <li><xref href="#STATS_TOTALS" format="dita">STATS_TOTALS</xref></li>
          <li><xref href="#STATS_AVERAGES" format="dita">STATS_AVERAGES</xref></li>
          <li>
            <xref href="#LISTS" format="dita">LISTS</xref></li>
          <li>
            <xref href="#MEM" format="dita">MEM</xref></li>
          <li><xref href="#USERS" format="dita">USERS</xref></li>
          <li><xref href="#VERSION" format="dita">VERSION</xref></li>
        </ul></p>
    </body>
    <topic id="ACTIVE_SOCKETS">
      <title>ACTIVE_SOCKETS</title>
      <body>
        <table frame="all" id="table_smh_1hl_gs">
          <title>Active Socket Information</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>type</entry>
                <entry>S, for server, C for client.</entry>
              </row>
              <row>
                <entry>user</entry>
                <entry>Username <codeph>pgbouncer</codeph> uses to connect to server.</entry>
              </row>
              <row>
                <entry>database</entry>
                <entry>Database name.</entry>
              </row>
              <row>
                <entry>state</entry>
                <entry>State of the server connection, one of <codeph>active</codeph>,
                    <codeph>used</codeph> or <codeph>idle</codeph>.</entry>
              </row>
              <row>
                <entry>addr</entry>
                <entry>IP address of PostgreSQL server.</entry>
              </row>
              <row>
                <entry>port</entry>
                <entry>Port of PostgreSQL server.</entry>
              </row>
              <row>
                <entry>local_addr</entry>
                <entry>Connection start address on local machine.</entry>
              </row>
              <row>
                <entry>local_port</entry>
                <entry>Connection start port on local machine.</entry>
              </row>
              <row>
                <entry>connect_time</entry>
                <entry>When the connection was made.</entry>
              </row>
              <row>
                <entry>request_time</entry>
                <entry>When last request was issued.</entry>
              </row>
              <row>
                <entry>wait</entry>
                <entry>Time waiting.</entry>
              </row>
              <row>
                <entry>wait_us</entry>
                <entry>Time waiting (microseconds).</entry>
              </row>
              <row>
                <entry>ptr</entry>
                <entry>Address of internal object for this connection. Used as unique
                  ID.</entry>
              </row>
              <row>
                <entry>link</entry>
                <entry>Address of client connection the server is paired with.</entry>
              </row>
              <row>
                <entry>remote_pid</entry>
                <entry>Process identifier of backend server process.</entry>
              </row>
              <row>
                <entry>tls</entry>
                <entry>TLS context.</entry>
              </row>
              <row>
                <entry>recv_pos</entry>
                <entry>Receive position in the I/O buffer.</entry>
              </row>
              <row>
                <entry>pkt_pos</entry>
                <entry>Parse position in the I/O buffer.</entry>
              </row>
              <row>
                <entry>pkt_remain</entry>
                <entry>Number of packets remaining on the socket.</entry>
              </row>
              <row>
                <entry>send_pos</entry>
                <entry>Send position in the packet.</entry>
              </row>
              <row>
                <entry>send_remain</entry>
                <entry>Total packet length remaining to send.</entry>
              </row>
              <row>
                <entry>pkt_avail</entry>
                <entry>Amount of I/O buffer left to parse.</entry>
              </row>
              <row>
                <entry>send_avail</entry>
                <entry>Amount of I/O buffer left to send.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="CLIENTS">
      <title>CLIENTS</title>
      <body>
        <table frame="all" id="table_dkj_2dl_gs">
          <title>Clients</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>type</entry>
                <entry>C, for client.</entry>
              </row>
              <row>
                <entry>user</entry>
                <entry>Client connected user.</entry>
              </row>
              <row>
                <entry>database</entry>
                <entry>Database name.</entry>
              </row>
              <row>
                <entry>state</entry>
                <entry>State of the client connection, one of <codeph>active</codeph>,
                    <codeph>used</codeph>, <codeph>waiting</codeph> or
                  <codeph>idle</codeph>.</entry>
              </row>
              <row>
                <entry>addr</entry>
                <entry>IP address of client, or <codeph>unix</codeph> for a socket
                  connection.</entry>
              </row>
              <row>
                <entry>port</entry>
                <entry>Port client is connected to.</entry>
              </row>
              <row>
                <entry>local_addr</entry>
                <entry>Connection end address on local machine.</entry>
              </row>
              <row>
                <entry>local_port</entry>
                <entry>Connection end port on local machine.</entry>
              </row>
              <row>
                <entry>connect_time</entry>
                <entry>Timestamp of connect time.</entry>
              </row>
              <row>
                <entry>request_time</entry>
                <entry>Timestamp of latest client request.</entry>
              </row>
              <row>
                <entry>wait</entry>
                <entry>Time waiting.</entry>
              </row>
              <row>
                <entry>wait_us</entry>
                <entry>Time waiting (microseconds).</entry>
              </row>
              <row>
                <entry>ptr</entry>
                <entry>Address of internal object for this connection. Used as unique
                  ID.</entry>
              </row>
              <row>
                <entry>link</entry>
                <entry>Address of server connection the client is paired with.</entry>
              </row>
              <row>
                <entry>remote_pid</entry>
                <entry>Process ID, if client connects with Unix socket and the OS supports
                  getting it.</entry>
              </row>
              <row>
                <entry>tls</entry>
                <entry>Client TLS context.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="CONFIG">
      <title>CONFIG</title>
      <body>
        <p>List of current PgBouncer parameter settings</p>
        <table frame="all" id="table_d2j_2dl_gs">
          <title>Config</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>key</entry>
                <entry> Configuration variable name</entry>
              </row>
              <row>
                <entry>value</entry>
                <entry> Configuration value</entry>
              </row>
              <row>
                <entry>changeable</entry>
                <entry>Either <codeph>yes</codeph> or <codeph>no</codeph>. Shows whether the
                  variable can be changed while running. If <codeph>no</codeph>, the variable
                  can be changed only at boot time.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="DATABASES">
      <title>DATABASES</title>
      <body>
        <table frame="all" id="table_gfj_2dl_gs">
          <title>Databases</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>name</entry>
                <entry>Name of configured database entry.</entry>
              </row>
              <row>
                <entry>host</entry>
                <entry>Host pgbouncer connects to.</entry>
              </row>
              <row>
                <entry>port</entry>
                <entry>Port pgbouncer connects to.</entry>
              </row>
              <row>
                <entry>database</entry>
                <entry>Actual database name pgbouncer connects to.</entry>
              </row>
              <row>
                <entry>force_user </entry>
                <entry>When user is part of the connection string, the connection between
                  pgbouncer and the database server is forced to the given user, whatever the
                  client user.</entry>
              </row>
              <row>
                <entry>pool_size</entry>
                <entry>Maximum number of server connections.</entry>
              </row>
              <row>
                <entry>reserve_pool</entry>
                <entry>The number of additional connections that can be created if the pool
                  reaches <codeph>pool_size</codeph>.</entry>
              </row>
              <row>
                <entry>pool_mode</entry>
                <entry>The database's override <codeph>pool_mode</codeph> or NULL if the default
                  will be used instead.</entry>
              </row>
              <row>
                <entry>max_connections</entry>
                <entry>Maximum number of connections for all pools for this database.</entry>
              </row>
              <row>
                <entry>current_connections</entry>
                <entry>The total count of connections for all pools for this database.</entry>
              </row>
              <row>
                <entry>paused</entry>
                <entry>Paused/unpaused state of the database.</entry>
              </row>
              <row>
                <entry>disabled</entry>
                <entry>Enabled/disabled state of the database.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
        <p/>
      </body>
    </topic>
    <topic id="DNS_HOSTS">
      <title>DNS_HOSTS</title>
      <body>
        <table frame="all" id="table_r4k_2dl_gs">
          <title>DNS Zones in Cache</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>hostname</entry>
                <entry>Host name</entry>
              </row>
              <row>
                <entry>ttl</entry>
                <entry>How many seconds until next lookup.</entry>
              </row>
              <row>
                <entry>addrs</entry>
                <entry>Comma-separated list of addresses.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="DNS_ZONES">
      <title>DNS_ZONES</title>
      <body>
        <table frame="all" id="table_r4k_2dl_gs">
          <title>DNS Zones in Cache</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>zonename</entry>
                <entry>Zone name</entry>
              </row>
              <row>
                <entry>serial</entry>
                <entry>Current DNS serial number</entry>
              </row>
              <row>
                <entry>count</entry>
                <entry>Hostnames belonging to this zone</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="FDS">
      <title>FDS</title>
      <body>
        <p><codeph>SHOW FDS</codeph> is an internal command used for an online restart, for
          example when upgrading to a new PgBouncer version. It displays a list of file descriptors
          in use with the internal state attached to them. This command blocks the internal
          event loop, so it should not be used while PgBouncer is in use.</p>
        <p>When the connected user has username "pgbouncer", connects through a Unix socket, and
          has the same UID as the running process, the actual file descriptors are passed over
          the connection.</p>
        <table frame="all" id="table_ugj_2dl_gs">
          <title>FDS</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>fd</entry>
                <entry>File descriptor numeric value.</entry>
              </row>
              <row>
                <entry>task</entry>
                <entry>One of <codeph>pooler</codeph>, <codeph>client</codeph>, or
                    <codeph>server</codeph>.</entry>
              </row>
              <row>
                <entry>user</entry>
                <entry>User of the connection using the file descriptor.</entry>
              </row>
              <row>
                <entry>database</entry>
                <entry>Database of the connection using the file descriptor.</entry>
              </row>
              <row>
                <entry>addr</entry>
                <entry>IP address of the connection using the file descriptor, "unix" if a Unix
                  socket is used.</entry>
              </row>
              <row>
                <entry>port</entry>
                <entry>Port used by the connection using the file descriptor.</entry>
              </row>
              <row>
                <entry>cancel</entry>
                <entry>Cancel key for this connection.</entry>
              </row>
              <row>
                <entry>link</entry>
                <entry>File descriptor for corresponding server/client. NULL if idle.</entry>
              </row>
              <row>
                <entry>client_encoding</entry>
                <entry>Character set used for the database.</entry>
              </row>
              <row>
                <entry>std_strings</entry>
                <entry>This controls whether ordinary string literals ('...') treat backslashes
                  literally, as specified in the SQL standard. </entry>
              </row>
              <row>
                <entry>datestyle</entry>
                <entry>Display format for date and time values. </entry>
              </row>
              <row>
                <entry>timezone</entry>
                <entry>The timezone for interpreting and displaying time stamps. </entry>
              </row>
              <row>
                <entry>password</entry>
                <entry><codeph>auth_user</codeph>'s password.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="LISTS">
      <title>LISTS</title>
      <body>
        <p>Shows the following PgBouncer statistcs in two columns: the item label and value.</p>
        <table frame="all" id="table_sqj_2dl_gs">
          <title>Count of PgBouncer Items</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Item</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>databases</entry>
                <entry>Count of databases.</entry>
              </row>
              <row>
                <entry>users</entry>
                <entry>Count of users.</entry>
              </row>
              <row>
                <entry>pools</entry>
                <entry>Count of pools.</entry>
              </row>
              <row>
                <entry>free_clients</entry>
                <entry>Count of free clients.</entry>
              </row>
              <row>
                <entry>used_clients</entry>
                <entry>Count of used clients.</entry>
              </row>
              <row>
                <entry>login_clients</entry>
                <entry>Count of clients in <codeph>login</codeph> state.</entry>
              </row>
              <row>
                <entry>free_servers</entry>
                <entry>Count of free servers.</entry>
              </row>
              <row>
                <entry>used_servers</entry>
                <entry>Count of used servers.</entry>
              </row>
              <row>
                <entry>dns_names</entry>
                <entry>Count of DNS names.</entry>
              </row>
              <row>
                <entry>dns_zones </entry>
                <entry>Count of DNS zones.</entry>
              </row>
              <row>
                <entry>dns_queries</entry>
                <entry>Count of DNS queries.</entry>
              </row>
              <row>
                <entry>dns_pending</entry>
                <entry>Count of in-flight DNS queries.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="MEM">
      <title>MEM</title>
      <body>
        <p>Shows cache memory information for these PgBouncer caches:<ul id="ul_uzj_2dl_gs">
            <li>user_cache</li>
            <li>db_cache </li>
            <li>pool_cache </li>
            <li>server_cache </li>
            <li>client_cache </li>
            <li>iobuf_cache </li>
          </ul></p>
        <table frame="all" id="table_ghk_2dl_gs">
          <title>In Memory Cache</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>name</entry>
                <entry>Name of cache.</entry>
              </row>
              <row>
                <entry>size</entry>
                <entry>The size of a single slot in the cache. </entry>
              </row>
              <row>
                <entry>used</entry>
                <entry>Number of used slots in the cache. </entry>
              </row>
              <row>
                <entry>free</entry>
                <entry>The number of available slots in the cache.</entry>
              </row>
              <row>
                <entry>memtotal</entry>
                <entry>Total bytes used by the cache.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="POOLS">
      <title>POOLS</title>
      <body>
        <p>A new pool entry is made for each pair of (database, user).</p>
        <table frame="all" id="table_n3j_2dl_gs">
          <title>Pools</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>database</entry>
                <entry>Database name.</entry>
              </row>
              <row>
                <entry>user</entry>
                <entry>User name.</entry>
              </row>
              <row>
                <entry>cl_active</entry>
                <entry>Client connections that are linked to server connection and can process
                  queries.</entry>
              </row>
              <row>
                <entry>cl_waiting</entry>
                <entry>Client connections have sent queries but have not yet got a server
                  connection.</entry>
              </row>
              <row>
                <entry>sv_active</entry>
                <entry>Server connections that linked to client.</entry>
              </row>
              <row>
                <entry>sv_idle</entry>
                <entry>Server connections that are unused and immediately usable for client
                  queries.</entry>
              </row>
              <row>
                <entry>sv_used</entry>
                <entry>Server connections that have been idle more than
                    <codeph>server_check_delay</codeph>. The <codeph>server_check_query</codeph>
                  query must be run on them before they can be used.</entry>
              </row>
              <row>
                <entry>sv_tested</entry>
                <entry>Server connections that are currently running either
                    <codeph>server_reset_query</codeph> or
                  <codeph>server_check_query</codeph>.</entry>
              </row>
              <row>
                <entry>sv_login</entry>
                <entry>Server connections currently in process of logging in.</entry>
              </row>
              <row>
                <entry>maxwait</entry>
                <entry>How long the first (oldest) client in the queue has waited, in seconds.
                  If this begins to increase, the current pool of servers does not handle
                  requests fast enough. The cause may be either an overloaded server or the
                    <codeph>pool_size</codeph> setting is too small.</entry>
              </row>
              <row>
                <entry>maxwait_us</entry>
                <entry><codeph>max_wait</codeph> (microseconds).</entry>
              </row>
              <row>
                <entry>pool_mode</entry>
                <entry>The pooling mode in use.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="SERVERS">
      <title>SERVERS</title>
      <body>
        <table frame="all" id="table_imj_2dl_gs">
          <title>Servers</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.78*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>type</entry>
                <entry>S, for server.</entry>
              </row>
              <row>
                <entry>user</entry>
                <entry>User ID that <codeph>pgbouncer</codeph> uses to connect to
                  server.</entry>
              </row>
              <row>
                <entry>database</entry>
                <entry>Database name.</entry>
              </row>
              <row>
                <entry>state</entry>
                <entry>State of the pgbouncer server connection, one of <codeph>active</codeph>,
                    <codeph>used</codeph>, or <codeph>idle</codeph>.</entry>
              </row>
              <row>
                <entry>addr</entry>
                <entry>IP address of the Greenplum or PostgreSQL server.</entry>
              </row>
              <row>
                <entry>port</entry>
                <entry>Port of the Greenplum or PostgreSQL server.</entry>
              </row>
              <row>
                <entry>local_addr</entry>
                <entry>Connection start address on local machine.</entry>
              </row>
              <row>
                <entry>local_port</entry>
                <entry>Connection start port on local machine.</entry>
              </row>
              <row>
                <entry>connect_time</entry>
                <entry>When the connection was made.</entry>
              </row>
              <row>
                <entry>request_time</entry>
                <entry>When the last request was issued.</entry>
              </row>
              <row>
                <entry>wait</entry>
                <entry>Time waiting.</entry>
              </row>
              <row>
                <entry>wait_us</entry>
                <entry>Time waiting (microseconds).</entry>
              </row>
              <row>
                <entry>close_needed</entry>
                <entry>1 if the connection will be closed as soon as possible, because a
                  configuration file reload or DNS update changed the connection information or
                    <codeph>RECONNECT</codeph> was issued.</entry>
              </row>
              <row>
                <entry>ptr</entry>
                <entry>Address of the internal object for this connection. Used as unique
                  ID.</entry>
              </row>
              <row>
                <entry>link</entry>
                <entry>Address of gthe client connection the server is paired with.</entry>
              </row>
              <row>
                <entry>remote_pid</entry>
                <entry>Pid of backend server process. If the connection is made over Unix socket
                  and the OS supports getting process ID info, it is the OS pid. Otherwise it is
                  extracted from the cancel packet the server sent, which should be PID in case
                  server is PostgreSQL, but it is a random number in case server is another
                  PgBouncer.</entry>
              </row>
              <row>
                <entry>tls</entry>
                <entry>TLS context.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="STATS">
      <title>STATS</title>
      <body>
        <p>Shows statistics.</p>
        <table frame="all" id="table_ubj_2dl_gs">
          <title>Stats</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>database</entry>
                <entry>Statistics are presented per database.</entry>
              </row>
              <row>
                <entry>total_xact_count</entry>
                <entry>Total number of SQL transactions pooled by PgBouncer.</entry>
              </row>
              <row>
                <entry>total_query_count</entry>
                <entry>Total number of SQL queries pooled by PgBouncer.</entry>
              </row>
              <row>
                <entry>total_received</entry>
                <entry>Total volume in bytes of network traffic received by
                    <codeph>pgbouncer</codeph>.</entry>
              </row>
              <row>
                <entry>total_sent</entry>
                <entry>Total volume in bytes of network traffic sent by
                    <codeph>pgbouncer</codeph>.</entry>
              </row>
              <row>
                <entry>total_xact_time</entry>
                <entry>Total number of microseconds spent by PgBouncer when connected to Greenplum Database in a transaction, either idle in transaction or executing queries.</entry>
              </row>
              <row>
                <entry>total_query_time</entry>
                <entry>Total number of microseconds spent by <codeph>pgbouncer</codeph> when
                  actively connected to the database server.</entry>
              </row>
              <row>
                <entry>total_wait_time</entry>
                <entry>Time spent (in microseconds) by clients waiting for a server.</entry>
              </row>
              <row>
                <entry>avg_xact_count</entry>
                <entry>Average number of SQL transactions pooled by PgBouncer.</entry>
              </row>
              <row>
                <entry>avg_query_count</entry>
                <entry>Average queries per second in last stats period.</entry>
              </row>
              <row>
                <entry>avg_recv</entry>
                <entry>Average received (from clients) bytes per second.</entry>
              </row>
              <row>
                <entry>avg_sent</entry>
                <entry>Average sent (to clients) bytes per second.</entry>
              </row>
              <row>
                <entry>avg_xact_time</entry>
                <entry>Average transaction duration in microseconds.</entry>
              </row>
              <row>
                <entry>avg_query_time</entry>
                <entry>Average query duration in microseconds.</entry>
              </row>
              <row>
                <entry>avg_wait_time</entry>
                <entry>Time spent by clients waiting for a server in microseconds (average per second).</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="STATS_AVERAGES">
      <title>STATS_AVERAGES</title>
      <body>
        <p>Subset of <codeph>SHOW STATS</codeph> showing the average values for selected statistics.</p>
      </body>
    </topic>
    <topic id="STATS_TOTALS">
      <title>STATS_TOTALS</title>
      <body>
        <p>Subset of <codeph>SHOW STATS</codeph> showing the total values for selected statistics.</p>
      </body>
    </topic>
    <topic id="USERS">
      <title>USERS</title>
      <body>
        <table frame="all" id="table_fyj_2dl_gs">
          <title>Users</title>
          <tgroup cols="2">
            <colspec colname="c1" colnum="1" colwidth="1*"/>
            <colspec colname="c2" colnum="2" colwidth="2.7*"/>
            <thead>
              <row>
                <entry>Column</entry>
                <entry>Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>name</entry>
                <entry>The user name</entry>
              </row>
              <row>
                <entry>pool_mode</entry>
                <entry>The user's override pool_mode, or NULL if the default will be used
                  instead.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </body>
    </topic>
    <topic id="VERSION">
      <title>VERSION</title>
      <body>
        <p>Display PgBouncer version information.</p>
        <note>This reference documentation is based on the PgBouncer 1.13 documentation.</note>
      </body>
    </topic>
  </topic>
  <topic id="seealso">
    <title>See Also</title>
    <body>
      <p><codeph><xref href="pgbouncer.xml#topic1" type="topic" format="dita"/></codeph>,
          <codeph><xref href="pgbouncer-ini.xml#topic1" type="topic" format="dita"/></codeph></p>
      </body>
  </topic>
</topic>
